32 file.setFileName(namefile);
34 if (
file.open(QIODevice::WriteOnly | QIODevice::Text))
37 QTextStream out(&
file);
38 out <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
39 out <<
"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"" <<
X_max-
X_min+200 <<
"\" height=\"" <<
Y_max-
Y_min+200 <<
"\">\n";
45 if(
file.open(QIODevice::Append | QIODevice::Text))
47 QTextStream out(&
file);
176 nb_max=nb_max+(int)qPow(nb_branche,i);
214 Frame frame_temp = frame_loc;
225 frame_temp=frame_loc;
227 double l=qCos(angle_temp/2*
PI/180)*sizePen_loc/2;
228 double d=qSin(angle_temp/2*
PI/180)*sizePen_loc/2;
230 frame_temp.
Add_alpha(-angle-angle_temp/2);
252 angle=angle+angle_temp;
307 QVector<QPointF> VectorQPointF;
313 VectorQPointF.append(QPointF(frame_temp.
Get_x2(),frame_temp.
Get_y2()));
320 VectorQPointF.append(QPointF(frame_temp.
Get_x2(),frame_temp.
Get_y2()));
327 VectorQPointF.append(QPointF(frame_temp.
Get_x2(),frame_temp.
Get_y2()));
333 VectorQPointF.append(QPointF(frame_temp.
Get_x2(),frame_temp.
Get_y2()));
336 QPolygonF PolygonF=QPolygonF(VectorQPointF);
342 Color.setRed(qrand()%255);
343 Color.setGreen(qrand()%255);
344 Color.setBlue(qrand()%255);
353 scene->addPolygon(PolygonF,Pen,Brush);
365 scene->addEllipse(X1,Y1,dX,dY,Pen,Brush);
377 if(
file.open(QIODevice::Append | QIODevice::Text))
379 QTextStream out(&
file);
380 out <<
"<line x1=\"" << x1 <<
"\" y1=\"" << y1 <<
"\" x2=\"" << x2 <<
"\" y2=\"" << y2 <<
"\" stroke=\"rgb(" << Color.red() <<
"," << Color.green() <<
"," << Color.blue() <<
")\" stroke-width=\"" << (int)
sizePen <<
"\"/>\n";
383 out <<
"<circle cx=\"" << x2 <<
"\" cy=\"" << y2 <<
"\" r=\"" <<
sizePen/2 <<
"\" fill=\"rgb(" << Color.red() <<
"," << Color.green() <<
"," << Color.blue() <<
")\"/> \n";
void Draw_Graph()
Desiner l'abre.
void Clear()
Clear la class.
QProgressBar * ProgressBar
double Get_Angle_By_Index(int index)
lib affichage de l'arbre
Stock_Prcent stock_prcent
Draw_Tree()
Constructeur de la classe.
void Plot(QWidget_trees *Widget_trees, QWidget_Config *Widget_Config, QWidget_Ratio *Widget_Ratio, QWidget_Graphique *Widget_Graphique)
Desiner l'arbre.
void Init(double x, double y, double d, double alpha)
void Save_file_svg(QString namefile)
Cree un fichier SVG.
double Get_Prcent_By_Index(int index)
void Init(QGraphicsScene *scene, QProgressBar *ProgressBar_Plot)
Initialise la class.
void Add_alpha(double alpha)